package com.yyjj.zixun.adapter;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yyjj.zixun.R;
import com.yyjj.zixun.activity.GanTouDetailsActivity;
import com.yyjj.zixun.activity.QuestionnaireActivity;
import com.yyjj.zixun.entity.BiTeBiNewsEntity;
import com.yyjj.zixun.entity.BiZiXunEntity;
import com.yyjj.zixun.entity.GuiJIngShuBaEntity;

import java.util.ArrayList;

import tech.com.commoncore.utils.FastUtil;
import tech.com.commoncore.utils.OnNoDoubleClickListener;


public class NeteaseAdapter extends BaseQuickAdapter<BiZiXunEntity, BaseViewHolder> {

    public NeteaseAdapter() {
        super(R.layout.zixun_item_ba, new ArrayList<BiZiXunEntity>());
    }

    @Override
    protected void convert(BaseViewHolder helper, final BiZiXunEntity item) {
        helper.setText(R.id.tv_title, item.getTitle());
        ImageView img = helper.getView(R.id.img_news);
        img.setVisibility(View.GONE);
        helper.itemView.setOnClickListener(new OnNoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                Bundle bundle = new Bundle();
                bundle.putSerializable("id",item.getUrl()+"");
                FastUtil.startActivity(mContext,GanTouDetailsActivity.class,bundle);
            }
        });

//        TextView time = helper.getView(R.id.tv_time);
//        helper.setText(R.id.tv_time, item.getTime());
//        helper.setText(R.id.tv_title, item.getTitle());
//
//
//        ImageView view = helper.getView(R.id.img_news);
////        view.setVisibility(View.GONE);
////        time.setVisibility(View.GONE);
//
//        Glide.with(mContext).load(item.getLogo()).into(view);
//
//
//        helper.itemView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Bundle bundle = new Bundle();
//                bundle.putSerializable("url",item.getUrl());
//                FastUtil.startActivity(mContext,QuestionnaireActivity.class,bundle);
//            }
//        });

    }
}
